package club.pchome.ex;

import club.pchome.dto.Result;

public class NormalException extends Exception {
	private static final long serialVersionUID = -2879009315337384347L;

	private Result<String> result;

	public NormalException() {
	}

	public Result<String> getResult() {
		return result;
	}

	public void setResult(Result<String> result) {
		this.result = result;
	}

	/**
	 * 构造一个含有result信息的异常(提示)信息
	 * 
	 * @param result
	 */
	public NormalException(Result<String> result) {
		super(result.getMsg());
		this.result = result;
	}

	public NormalException(String msg) {
		try {
			this.result = Result.initFailureResult(Result.ERROR_CORD, msg);
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}
